<%--
  Created by IntelliJ IDEA.
  User: zhuya
  Date: 2016/1/28
  Time: 16:45
  办事咨询 ----我的提问页面
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>监管预约</title>
    <link rel="stylesheet" href="<c:url value="/resource/wechat/css/frozen.css"></c:url>">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resource/wechat/css/main.css"></c:url>"/>
</head>
<body class="bg_fff" ontouchstart>

<section class="ui-container">

    <div class="jgyy_form">
        <h1>留所服刑罪犯家属视频会见预约申请表</h1>

        <form method="post" id="jsspForm">
            <div class="row mart0">
                <label>会见人姓名:</label>
                <div>
                    <input type="text" name="J_hyrname" id="name"/>
                </div>

            </div>
            <div class="row">
                <label>身份证号:</label>

                <div>
                    <input type="text" name="J_sfzhm" id="idcard"/>
                </div>
            </div>
            <div class="row">
                <label>手机号码:</label>

                <div>
                    <input type="text"  name="J_phone" id="phone"/>
                </div>
            </div>
            <div class="row">
                <label>性别:</label>
                <div>
                    <input checked="checked" type="radio" style="margin-left: 5px;" name="J_xb" value="男"/> 男
                    <input type="radio" style="margin-left: 5px;" name="J_xb" value="女"/> 女
                </div>
            </div>
            <div class="row">
                <label>QQ号:</label>

                <div>
                    <input type="text" name="J_qq" id="qq"/>
                </div>
            </div>
            <div class="row">
                <label class="twoline">与被监管人关系:</label>

                <div>
                    <input type="text" name="J_ybjgrgx" id="relation"/>
                </div>
            </div>
            <div class="row">
                <label class="twoline">会见人所在单位:</label>

                <div>
                    <input type="text"  name="J_hjrszdw" id="danwei"/>
                </div>
            </div>
            <div class="row">
                <label>家庭住址:</label>

                <div>
                    <input type="text" name="J_jtzz" id="address"/>
                </div>
            </div>
            <div class="row">
                <label>事由:</label>

                <div>
                    <input type="text" name="J_sy" id="reason"/>
                </div>
            </div>
            <%--<div class="row">--%>
                <%--<label>委托人姓名:</label>--%>

                <%--<div>--%>
                    <%--<input type="text" name="J_wtrxm"/>--%>
                <%--</div>--%>
            <%--</div>--%>
            <%--<div class="row">--%>
                <%--<label>身份证号码:</label>--%>

                <%--<div>--%>
                    <%--<input type="text" name="J_wtrsfzh"/>--%>
                <%--</div>--%>
            <%--</div>--%>
            <%--<div class="row">--%>
                <%--<label>手机号码:</label>--%>

                <%--<div>--%>
                    <%--<input type="text"  name="J_wtrsjhm"/>--%>
                <%--</div>--%>
            <%--</div>--%>
            <h1>在押人员信息</h1>

            <div class="row mart0">
                <label>姓名:</label>

                <div>
                    <input type="text" name="J_zyxm" id="xingming"/>
                </div>
            </div>
            <div class="row">
                <label>性别:</label>

                <div>
                    <input checked="checked" type="radio" style="margin-left: 5px;" name="J_zyxb" value="男"/> 男
                    <input type="radio" style="margin-left: 5px;" name="J_zyxb"  value="女"/> 女
                </div>
            </div>
            <%--<div class="row">
                <label>出生年月:</label>

                <div>
                    <input type="date" name="J_zycsny" id="birth" style="height: 36px; display: block"/>
                </div>
            </div>--%>
            <div class="row">
                <label>身份证号:</label>

                <div>
                    <input type="text" name="J_zysfzh" id="shenfen"/>
                </div>
            </div>
            <%--<div class="row">--%>
                <%--<label>住址:</label>--%>

                <%--<div>--%>
                    <%--<input type="text" name="J_zyzz"/>--%>
                <%--</div>--%>
            <%--</div>--%>
            <div class="row">
                <label>在押看守所:</label>

                <div>
                    <input type="text" name="J_zykss" value="${orgName}" id="yana" readonly="readonly"/>
                </div>
            </div>

           <%-- <div class="row big">
                <label>案由:</label>

                <div>
                    <textarea name="J_zyay" id="fanzui"></textarea>
                </div>

            </div>--%>
            <div class="row">
                <label class="twoline">预约会见日期:</label>
                <div>
                    <%--<input id="time" type="date" name="J_yyhjrq" style="height: 36px; display: block"/>--%>
                    <select id="time" name="J_yyhjrq" style="height: 36px; display: block">
                        <c:forEach var="rq" items="${yyrq}">
                            <option value="${rq}">${rq}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="row">
                <label>预约时间:</label>

                <div>
                    <input type="radio" style="margin-left: 5px;"  name="J_yysj" value="上午" checked/> 上午
                    <input type="radio" style="margin-left: 5px;"   name="J_yysj" value="下午"/> 下午
                </div>
            </div>
            <input type="hidden" name="userGuid" value="${member.guid}">
            <input type="hidden" name="caseNo" value="${caseNo}">  <%--公安提取案件编号  --%>
            <input type="hidden" name="tableName" value="Form_data_u2e62">
            <input type="hidden" name="appType"  value="5">
            <input type="hidden" name="orgId"  value="${orgId}">
            <input type="hidden" name="pt"  value="${pt}">
        </form>
        <div class="but_main">

            <%--<button class="ui-btn-lg ui-btn-danger lf50" onclick="_close()">
                关闭
            </button>--%>
            <button id="yuyue" class="ui-btn-lg ui-btn-primary lf50 marlf2" onclick="doSubmit();" style="width:96%;align:center">
                预 约
            </button>

        </div>
    </div>

</section>
<script src="<c:url value='/resource/js/jquery-2.0.min.js'/>"></script>
<script src="<c:url value="/resource/js/jquery.serializejson.min.js"></c:url>"></script>
<script>
    function _close(){
        location.href = "<c:url value='/api/case/index'/>";
    }

    function doSubmit() {
        if($("#name").val() == ""){
            alert("请输入会见人姓名");
            return;
        }
        if($("#idcard").val() == ""){
            alert("请输入会见人身份证号");
            return;
        }
        if($("#phone").val() == ""){
            alert("请输入会见人手机号");
            return;
        }
        if($("#qq").val() == ""){
            alert("请输入会见人QQ号");
            return;
        }
        if($("#relation").val() == ""){
            alert("请输入会见人与被监管人关系");
            return;
        }
        if($("#danwei").val() == ""){
            alert("请输入会见人单位");
            return;
        }
        if($("#address").val() == ""){
            alert("请输入会见人家庭住址");
            return;
        }
        if($("#reason").val() == ""){
            alert("请输入会见事由");
            return;
        }
        if($("#xingming").val() == ""){
            alert("请输入在押人姓名");
            return;
        }
        if($("#birth").val() == ""){
            alert("请输入在押人出生年月");
            return;
        }
        if($("#shenfen").val() == ""){
            alert("请输入在押人身份证号");
            return;
        }
        if($("#yana").val() == ""){
            alert("请输入在押看守所");
            return;
        }
        if($("#fanzui").val() == ""){
            alert("请输入在押人案由");
            return;
        }
        if($("#time").val() == ""){
            alert("请输入预约会见时间");
            return;
        }
        var form = $("#jsspForm").serializeJSON();
        $("#yuyue").attr("disabled","disabled");
        $.ajax({
            url: "<c:url value="/api/project/doarrangementJg"></c:url>",
            data: JSON.stringify(form),
            type: 'post',
            contentType: "application/json",
            success: function (resp) {
                if (resp["succ"]) {
                    alert("预约已提交");
                } else {
                    $("#yuyue").attr("disabled",false);
                    alert("提交失败");
                }
            },
            error: function (resp) {
                $("#yuyue").attr("disabled",false);
                alert("提交失败,请重新操作");
            }
        });

    }
</script>
</body>
</html>
